<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:p="http://primefaces.prime.com.tr/ui" >

<head>

</head>
<body>


	<ui:composition template="../WEB-INF/layout/template.xhtml">
		<ui:define name="title"><h:outputText value="#{msg.add_new_user}" /></ui:define>
		<ui:define name="content">
		
			<div style="width:750px;margin:auto;">
				<p:panel id="panel">
					<p:fieldset id="field">
						<legend><h:outputText value="#{msg.user_data}"/></legend>
						<small>(<h:outputText value="#{msg.mandatory_fields}"/>)</small>
						<h:form id="insertForum">

							<h:panelGrid columns="3">
					
								<h:outputText value="#{msg.username} *: "/>
								<p:inputText id="username" value="#{inserisciUtenteBean.userInput.username}" required="true">
									<f:validator validatorId="usernameValidator" style="color:red;"/>
									<f:validateLength minimum="8" maximum="40"/>
								</p:inputText>
								<p:message for="username" style="color:red;"/>
								
								<h:outputText value="#{msg.password} *: "/>
								<p:password id="password" value="#{inserisciUtenteBean.userInput.password}" required="true" binding="#{inserisciUtenteBean.password}">
									<f:validateLength minimum="8"/>
								</p:password>
								<p:message for="password" style="color:red;"/>
								
								<h:outputText value="#{msg.confirm_password} *: "/>
								<p:password id="confirm_password" value="#{inserisciUtenteBean.userInput.confirmPassword}" required="true" binding="#{inserisciUtenteBean.confirmPassword}">
									<f:validateLength minimum="8"/>
								</p:password>
								<p:message for="confirm_password" style="color:red;"/>
								
								<h:outputText value="#{msg.user_type} *: "/>
								<h:selectOneMenu id="som" value="#{inserisciUtenteBean.userType}" title="select any one in this menu">
									<f:selectItems value="#{inserisciUtenteBean.selectUserTypeOptions}"/>
									<f:validator validatorId="selectOneMenuValidator"/>
								</h:selectOneMenu>
								<p:message for="som" style="color:red;"/>
						
							</h:panelGrid>					
						
							<p:commandButton value="#{msg.submit}" action="#{inserisciUtenteBean.submit}" update="field" ajax="false"/>
				
						</h:form>
				
					</p:fieldset>
				</p:panel>
			</div>
			
			
		</ui:define>
	</ui:composition>



</body>
</html>
